import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Router } from '@angular/router';

@Component({
    selector: 'app-home',
    templateUrl: './home.component.html',
    styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
    private allTaoti = '/api/TaoTi/all';
    taoTiList: String[];

    constructor(private http: HttpClient, private router: Router) {}

    ngOnInit() {
        this.http.get(`${this.allTaoti}`).subscribe(response => {
            this.taoTiList = response as String[];
        });
    }

    RedirectTo(id: string) {
        this.router.navigate([`/content/examination/${id}`]);
    }
}
